<template>
  <div class="recommend-wrap">
    <div class="title">热销推荐</div>
    <ul>
      <router-link  class="item border-bottom" v-for="item of list" :key="item.id" tag='li' :to="'/detail/' + item.id">
        <img
          class="item-img"
          :src="item.imgUrl"
        >
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
          <button class="item-btn">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: "HomeRecommend",
   props:{
    list:Array
  },
  data() {
    return {
      recommendList: [
        {
          id: "0001",
          imgUrl:
            "http://img1.qunarzz.com/sight/p0/1502/e0/e055cb2c79da8f33.water.jpg_200x200_93193a93.jpg",
          title: "大连圣亚海洋世界",
          desc: "浪漫大连首站，浪漫的海洋主题乐园"
        },
        {
          id: "0002",
          imgUrl:
            "http://img1.qunarzz.com/sight/p0/1611/25/2560c84835f4d6ea3.img.jpg_200x200_1e5407ef.jpg",
          title: "燊海森林 海汤神泉",
          desc: "酥糊的温泉，还不快来泡一泡"
        },
        {
          id: "0003",
          imgUrl:
            "http://img1.qunarzz.com/sight/p0/1712/16/16dd785ae3e2447ba3.img.jpg_200x200_c0ef018f.jpg",
          title: "峨眉山",
          desc: "峨眉金顶，趴一趴，健康一整天"
        },
        {
          id: "0004",
          imgUrl:
            "http://img1.qunarzz.com/sight/p0/201305/08/c5c262c16bebca42c8d65eac.jpg_200x200_f63827b2.jpg",
          title: "乐山大佛",
          desc: "古老而又神秘的大佛，树立千年，端庄威严，还不快来看一看"
        }
      ]
    };
  }
};
</script>

<style lang="stylus" scoped>
@import '~styles/mixins.styl';

.recommend-wrap {
  .title {
    background: #eee;
    line-height: 0.8rem;
    text-indent: 0.2rem;
    margin-top: 0.2rem;
  }

  .item {
    display: flex;
    height: 1.9rem;

    // background: red;
    // overflow: hidden;
    .item-img {
      width: 1.7rem;
      height: 1.7rem;
      padding: 0.1rem;
    }

    .item-info {
      flex: 1;
      padding: 0.1rem;
      overflow: hidden;

      .item-title {
        line-height: 0.54rem;
        font-size: 0.32rem;
        ellipsis();
      }

      .item-desc {
        color: #cccccc;
        line-height: 0.4rem;
        ellipsis();
      }

      .item-btn {
        line-height: 0.44rem;
        padding: 0 0.2rem;
        background: #ff9300;
        color: #fff;
        margin-top: 0.33rem;
        border-radius: 0.06rem;
      }
    }
  }
}
</style>
